export function debounce(fn, delay = 2000) {
  let timer = null;
  const debounceFn = (...args) => {
    if(timer) {
      clearTimeout(timer);
      timer = null;
    }
    timer = setTimeout(() => {
      console.log(fn);
      fn(...args);
    }, 2000)
  }
  return debounceFn;
}
